package homework;

import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try (
                FileOutputStream fos = new FileOutputStream("brithday.txt");//等同于finally中调用close()的关闭操作
        ) {
            fos.write(39);
        } catch (IOException e) {
            System.out.println("IO异常的解决方法");
        }
        System.out.println("程序结束了");
        System.out.println("..");

    }
}
